package com.aidex.biz.service.impl;

import java.util.List;

import com.aidex.common.annotation.DataScope;
import com.github.pagehelper.PageInfo;
import com.aidex.common.core.domain.entity.SysUser;
import com.aidex.common.core.domain.entity.SysDept;
import com.aidex.common.core.service.BaseServiceImpl;
import com.aidex.framework.cache.DeptUtils;
import com.aidex.framework.cache.UserUtils;
import org.springframework.stereotype.Service;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.aidex.biz.mapper.ZhuangkuLogMapper;
import com.aidex.biz.domain.ZhuangkuLog;
import com.aidex.biz.service.ZhuangkuLogService;
import org.springframework.transaction.annotation.Transactional;
import com.aidex.common.utils.NumberUtils;

/**
 * 撞库日志Service业务层处理
 *
 * @author sean
 * @email 2074844820@qq.com
 * @date 2025-03-21
 */
@Service
@Transactional(readOnly = true)
public class ZhuangkuLogServiceImpl extends BaseServiceImpl<ZhuangkuLogMapper, ZhuangkuLog> implements ZhuangkuLogService {
    private static final Logger log = LoggerFactory.getLogger(ZhuangkuLogServiceImpl.class);

    /**
     * 获取单条数据
     *
     * @param zhuangkuLog 撞库日志
     * @return 撞库日志
     */
    @Override
    public ZhuangkuLog get(ZhuangkuLog zhuangkuLog) {
        ZhuangkuLog dto = super.get(zhuangkuLog);
        return dto;
    }

    /**
     * 获取单条数据
     *
     * @param id 撞库日志id
     * @return 撞库日志
     */
    @Override
    public ZhuangkuLog get(String id) {
        ZhuangkuLog dto = super.get(id);
        return dto;
    }


    /**
     * 查询撞库日志列表
     *
     * @param zhuangkuLog 撞库日志
     * @return 撞库日志
     */
    @Override
    @DataScope(userAlias = "a", deptAlias = "a")
    public List<ZhuangkuLog> findList(ZhuangkuLog zhuangkuLog) {
        return super.findList(zhuangkuLog);
    }

    /**
     * 分页查询撞库日志列表
     *
     * @param zhuangkuLog 撞库日志
     * @return 撞库日志
     */
    @Override
    @DataScope(userAlias = "a", deptAlias = "a")
    public PageInfo<ZhuangkuLog> findPage(ZhuangkuLog zhuangkuLog) {
        return super.findPage(zhuangkuLog);
    }

    /**
     * 保存撞库日志
     *
     * @param zhuangkuLog
     * @return 结果
     */
    @Override
    public boolean save(ZhuangkuLog zhuangkuLog) {
        return super.save(zhuangkuLog);
    }


    /**
     * 删除撞库日志信息
     *
     * @param zhuangkuLog
     * @return 结果
     */
    @Override
    public boolean remove(ZhuangkuLog zhuangkuLog) {
        return super.remove(zhuangkuLog);
    }

    /**
     * 批量删除撞库日志
     *
     * @param ids 需要删除的撞库日志ID
     * @return 结果
     */
    @Transactional(readOnly = false)
    @Override
    public int deleteZhuangkuLogByIds(String[] ids) {
        return mapper.deleteZhuangkuLogByIds(ids);
    }

    /**
     * 获取最大编号
     *
     * @param zhuangkuLog 撞库日志
     * @return 结果
     */
    @Override
    public int findMaxSort(ZhuangkuLog zhuangkuLog) {
        return NumberUtils.nextOrder(mapper.findMaxSort(zhuangkuLog));
    }

    @Override
    public ZhuangkuLog findOne(ZhuangkuLog zhuangkuLog) {
        return mapper.findOne(zhuangkuLog);
    }
}
